<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理后台</title>
<link rel="stylesheet" href="{skin:css/admin.css}" />
{js:jquery}
{js:dialog}
{js:form}
{js:validate}
<script type='text/javascript' src="{theme:javascript/admin.js}"></script>
</head>
{set:$dev = IClient::getDevice()}
<body style="{if:$dev=="pc"}width:700px;overflow-y: hidden;{/if}min-height: 400px;">
<div class="pop_win">
	<form name="groupPriceForm">
		{if:$dev=="pc"}
			<table class="border_table" style="width:100%">
				<thead>
					<tr>
						<th>会员组名称</th>
						<th>商品价格</th>
						<th>默认价格</th>
						<th>会员组折扣率</th>
					</tr>
				</thead>
				<tbody>
					{query:name=user_group}
					<tr class='td_c'>
						<td>{$item['group_name']}</td>
						<td><input type="text" name="groupPrice{$item['id']}" class="small" pattern="float" /></td>
						<td>￥{echo:($item['discount']/100)*$sell_price}</td>
						<td>{$item['discount']}%</td>
					</tr>
					{/query}
				</tbody>
			</table>
			{else:}
			<table class="border_table" style="width:100%">
				{query:name=user_group}
				<tr>
					<th>会员组名</th>
					<td>{$item['group_name']}</td>
				</tr>
				<tr>
					<th>商品价格</th>
					<td><input type="text" name="groupPrice{$item['id']}" class="small" pattern="float" /></td>
				</tr>
				<tr>
					<th>默认价格</th>
					<td>￥{echo:($item['discount']/100)*$sell_price}</td>
				</tr>
				<tr>
					<th>折扣率</th>
					<td>{$item['discount']}%</td>
				</tr>
				{/query}
			</table><br>
		{/if}
	</form>
</div>
<script type='text/javascript'>
$(function(){
	var groupPrice = art.dialog.data('groupPrice');
	if(groupPrice)
	{
		var groupPriceObject = $.parseJSON(groupPrice);
		for(var groupId in groupPriceObject)
		{
			$('input[name="groupPrice'+groupId+'"]').val(groupPriceObject[groupId]);
		}
	}
});
</script>
</body>
</html>
